/*
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-04-12 14:42:27
 * @LastEditTime: 2025-10-16 15:03:26
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 模块信息配置
 * @FilePath: \vue-code-design\templates\vue3ElementPlus\DrawerDemo\config\module.js
 * @Copyright 版权声明
 */
import { defineAsyncComponent, shallowRef } from 'vue'

export const GLOBAL_MODULE = {
  // {{{=it.newOptions.MODULE_VALUE || ""}}} 模块配置
  {{{=it.newOptions.MODULE_VALUE || ""}}}: {
    // 模块名称
    name: '{{{=it.newOptions.moduleTitle || ""}}}',
    // 模块名称英文标识
    value: '{{{=it.newOptions.MODULE_VALUE || ""}}}',
    // 抽屉相关配置
    drawer: {
      // 抽屉入口组件
      components: shallowRef(defineAsyncComponent(() => import('@/views/{{{=it.newOptions.MODULE_VALUE || ""}}}/components/Drawer/index.vue'))),
      // 抽屉类型枚举
      type: {
        {{{? true === it.newOptions.formConfig.hasCreate }}}
        CREATE: {
          // 名称
          name: '{{{=it.newOptions.formConfig.createTitle || "新增"}}}',
          // 标识
          value: 'CREATE',
          // 是否在关闭 Drawer时 二次确认
          closeConfirm: true,
          {{{? 'drawer' !== it.newOptions.formConfig.createLayoutType }}}
          layoutType: '{{{=it.newOptions.formConfig.createLayoutType || "drawer"}}}'
          {{{?}}}
        },
        {{{?}}}
        {{{? true === it.newOptions.formConfig.hasUpdate }}}
        UPDATE: {
          name: '{{{=it.newOptions.formConfig.updateTitle || "编辑"}}}',
          value: 'UPDATE',
          closeConfirm: true,
          {{{? 'drawer' !== it.newOptions.formConfig.updateLayoutType }}}
          layoutType: '{{{=it.newOptions.formConfig.updateLayoutType || "drawer"}}}'
          {{{?}}}
        },
        {{{?}}}
        {{{? true === it.newOptions.formConfig.hasDetail }}}
        DETAIL: {
          name: '{{{=it.newOptions.formConfig.detailTitle || "详情"}}}',
          value: 'DETAIL',
          {{{? 'drawer' !== it.newOptions.formConfig.detailLayoutType }}}
          layoutType: '{{{=it.newOptions.formConfig.detailLayoutType || "drawer"}}}'
          {{{?}}}
        },
        {{{?}}}
      }
    }
  }
}
